package virtualstock.request;
import java.math.BigDecimal;
import java.util.HashMap;

import javax.ejb.Remote;

import virtualstock.exception.InsufficientCreditException;
import virtualstock.exception.InsufficientShareException;
import virtualstock.exception.InvalidParameterException;
import virtualstock.exception.PortfolioNotFoundException;
import virtualstock.exception.StockNotFoundException;
import virtualstock.exception.TransactionNotFoundException;
import virtualstock.util.TransactionDetails;

@Remote
public interface TransactionController {
	
	public void buy(Long portfolioID, Long stockID, int share, BigDecimal currentPrice) throws InvalidParameterException, PortfolioNotFoundException, StockNotFoundException, InsufficientCreditException;
	
	public void sell(Long portfolioID, Long stockID, int share, BigDecimal currentPrice) throws InvalidParameterException, PortfolioNotFoundException, StockNotFoundException, InsufficientShareException;
	
	public TransactionDetails getDetails(Long transactionID) throws InvalidParameterException, TransactionNotFoundException;
	
	public int getShareInPortfolio(Long portfolioID, Long stockID) throws InvalidParameterException, PortfolioNotFoundException, StockNotFoundException;
	
	public HashMap<Long, Integer> getStocksInPortfolio(Long portfolioID) throws InvalidParameterException, PortfolioNotFoundException, StockNotFoundException;

}
